﻿//$(function () {
//    var mongoDB = new MongoLab('FlgTc4pFh1IVFPfxXF2q4qnfBWksx4Sw');

//    //Info about offer
//    var car = new TripDetails.Vehicle("кола", "форд", 1995, 5, 9);
//    var driver = new TripDetails.Driver("Mitio", "Pishtova", "krisiI@abv.bg", "123", 18, "m", car, "10", "no smoking!");
//    var trip = new TripDetails.Trip("София", "Варна", 320, "12.04.2013");
//    var price = new TripDetails.Price(3, 'лв.');

//    //the offer
//    var offer = new TripDetails.Offer(driver, price, trip);

//    //insert it into the db
//    //mongoDB.insertDocuments('vozime_db', 'drivers', offer);


//    var allOffers = [];
//    //insert offers in array
//    mongoDB.listDocuments('vozime_db', 'drivers', function (offers) {
//        for (var i = 0; i < offers.length; i++) {
//            var o = new TripDetails.Offer(offers[i].driver, offers[i].price, offers[i].trip);
//            console.log(o);
//            allOffers.push(o);
//        }
//    });
    
//    console.log(allOffers);
//    console.log(allOffers.length);

//    //for (var i = 0; i < allOffers.length; i++) {
//    //    console.log("--- Offer" + i + " ---");
//    //    console.log("--- Driver info ---");
//    //    allOffers[i].driver.toString();
//    //}

//    ////insert documents
//    //mongoDB.insertDocuments('universitysystem', 'StudentName', { JSLIBTEST: 'testing' }, function (data) {
//    //    console.log('Insert Documents : ', data);
//    //});

//    ////delete document
//    //mongoDB.deleteDocument('universitysystem', 'StudentName', '51af5bc8e4b0a9100b84eeb5', function (data) {
//    //    console.log('Delete Document : ', data);
//    //});

//    //var st = new universitySystem.Student("fname", "lname", "none@none.no");
//    //var ass = new universitySystem.Assistant("fname", "lname");
//    //console.log(st.workLoad());
//    //console.log(ass.fullname());

//    //var students = [];


//    //mongoDB.listDocuments('universitysystem', 'StudentName', function (data) {
//    //    for (var i = 0; i < data.length; i++) {
//    //        var student = new universitySystem.Student(data[i].Name);
//    //        students.push(student);
//    //    }
//    //});

//});